home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / SHELL.ELC < prev    next >
Text File  |  1993-03-28  |  9KB  |  110 lines

  1. ;;; compiled by jwz@thalidomide on Wed Dec 16 10:00:16 1992
  2. ;;; from file /u/jwz/emacs19/lisp/comint/shell.el
  3. ;;; emacs version 19.4 Lucid.
  4. ;;; bytecomp version 2.08; 27-aug-92.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs18.
  7.  
  8. (if (and (boundp 'emacs-version)
  9.      (or (and (boundp 'epoch::version) epoch::version)
  10.          (string-lessp emacs-version "19")))
  11.     (error "This file was compiled for Emacs19."))
  12.  
  13. (byte-code "└┴!ê┬├!ê─┼╞╟#ç" [require comint provide shell put shell-prompt-pattern variable-documentation "Regexp to match prompts in the inferior shell.\nDefaults to \"^[^#$%>]*[#$%>] *\", which works pretty well.\nThis variable is used to initialise comint-prompt-regexp in the \nshell buffer.\n\nThis is a fine thing to set in your .emacs file."] 4)
  14. (defvar shell-popd-regexp "popd" "\
  15. *Regexp to match subshell commands equivalent to popd.")
  16. (defvar shell-pushd-regexp "pushd" "\
  17. *Regexp to match subshell commands equivalent to pushd.")
  18. (defvar shell-cd-regexp "cd" "\
  19. *Regexp to match subshell commands equivalent to cd.")
  20. (defvar explicit-shell-file-name nil "\
  21. *If non-nil, is file name to use for explicitly requested inferior shell.")
  22. (defvar explicit-csh-args (byte-code "┴=½é┬ç├ç" [system-type hpux ("-i" "-T") ("-i")] 2) "\
  23. *Args passed to inferior shell by M-x shell, if the shell is csh.
  24. Value is a list of strings, which may be nil.")
  25. (defvar shell-dirstack nil "\
  26. List of directories saved by pushd in this buffer's shell.")
  27. (defvar shell-dirstack-query "dirs" "\
  28. Command used by shell-resync-dirlist to query shell.")
  29. (byte-code "└┴!¼é┬    ¼║├─!½û┼ ─\"ê╚┴\"ê)¬ä╔!╩╦╠#ê╩═╠#ê╩╬╧#ê)┬ç" [boundp shell-mode-map nil fboundp set-keymap-parent make-keymap map comint-mode-map set-keymap-name full-copy-sparse-keymap define-key "ë" comint-dynamic-complete "    " "┐" comint-dynamic-list-completions] 4)
  30. (defvar shell-mode-hook nil "\
  31. *Hook for customising shell mode")
  32. (fset 'shell-mode #[nil "└ ê    ├┼╟!ê╔╩!ê╦\n╔╠!ê═ ╬╨╤!ç" [comint-mode shell-prompt-pattern comint-prompt-regexp shell-mode major-mode "shell" mode-name use-local-map shell-mode-map make-local-variable shell-dirstack nil shell-dirtrackp t shell-directory-tracker comint-input-sentinel run-hooks shell-mode-hook] 2 "\
  33. Major mode for interacting with an inferior shell.
  34. Return after the end of the process' output sends the text from the 
  35.     end of process to the end of the current line.
  36. Return before end of process output copies rest of line to end (skipping
  37.     the prompt) and sends it.
  38. M-x send-invisible reads a line of text without echoing it, and sends it to
  39.     the shell.
  40.  
  41. If you accidentally suspend your process, use \\[comint-continue-subjob]
  42. to continue it.
  43.  
  44. cd, pushd and popd commands given to the shell are watched by Emacs to keep
  45. this buffer's default directory the same as the shell's working directory.
  46. M-x shell-resync-dirs queries the shell and resyncs Emacs' idea of what the 
  47.     current directory stack is.
  48. M-x shell-dirtrack-toggle turns directory tracking on and off.
  49.  
  50. \\{shell-mode-map}
  51. Customisation: Entry to this mode runs the hooks on comint-mode-hook and
  52. shell-mode-hook (in that order).
  53.  
  54. Variables shell-cd-regexp, shell-pushd-regexp and shell-popd-regexp are used
  55. to match their respective commands." nil])
  56. (fset 'shell #[nil "└┴!¼╔\n«ï├─!«å├┼!«ü╞╚!    ╩    P ╠═    ╬Q!╨╤╥╙ !¡é ½ï╘!½àJ¬ü╒%qê╓ ê,╫┴!ç" [comint-check-proc "*shell*" explicit-shell-file-name getenv "ESHELL" "SHELL" "/bin/sh" prog file-name-nondirectory name "~/.emacs_" startfile intern-soft "explicit-" "-arguments" xargs-name apply make-comint "shell" file-exists-p boundp ("-i") shell-mode switch-to-buffer] 7 "\
  57. Run an inferior shell, with I/O through buffer *shell*.
  58. If buffer exists but shell process is not running, make new shell.
  59. If buffer exists and shell process is running, 
  60.  just switch to buffer *shell*.
  61. Program used comes from variable explicit-shell-file-name,
  62.  or (if that is nil) from the ESHELL environment variable,
  63.  or else from SHELL if there is no ESHELL.
  64. If a file ~/.emacs_SHELLNAME exists, it is given as initial input
  65.  (Note that this may lose due to a timing error if the shell
  66.   discards input when it starts up.)
  67. The buffer is put in shell-mode, giving commands for sending input
  68. and controlling the subjobs of the shell.  See shell-mode.
  69. See also variable shell-prompt-pattern.
  70.  
  71. The shell file name (sans directories) is used to make a symbol name
  72. such as `explicit-csh-arguments'.  If that symbol is a variable,
  73. its value is used as a list of arguments when invoking the shell.
  74. Otherwise, one argument `-i' is passed to the shell.
  75.  
  76. (Type \\[describe-mode] in the shell buffer for a list of commands.)" nil])
  77. (fset 'shell-front-match #[(regexp str start) "┴\n #=ç" [start string-match regexp str] 5])
  78. (fset 'shell-directory-tracker #[(str) "¡┴┴┬ \"ê─ò┼╚     #ë½å╩!¬ó╚ #ë½å╠!¬É╚ #ë¡ä╬!*ç" [shell-dirtrackp string-match "^\\s *" str 0 nil x bos shell-match-cmd-w/optional-arg shell-popd-regexp shell-process-popd shell-pushd-regexp shell-process-pushd shell-cd-regexp shell-process-cd] 4 "\
  79. Tracks cd, pushd and popd commands issued to the shell.
  80. This function is called on each input passed to the shell.
  81. It watches for cd, pushd and popd commands and sets the buffer's
  82. default directory to track these commands.
  83.  
  84. You may toggle this tracking on and off with M-x shell-dirtrack-toggle.
  85. If emacs gets confused, you can resync with the shell with M-x shell-resync-dirs.
  86.  
  87. See variables shell-cd-regexp, shell-pushd-regexp, and shell-popd-regexp."])
  88. (byte-code "└┴Mê┬├Mê─┼Mê╞╟Mê╚╔Mê╩╦Mç" [shell-match-cmd-w/optional-arg #[(cmd str start) "└    \n #¡₧─ò└╞\n#½â╟¬É└╚\n#½ê\n╔ö╔òO¬ü╩)ç" [shell-front-match cmd str start 0 eoc "\\s *\\(;\\|$\\)" "" "\\s +\\([^     ;]+\\)\\s *\\(;\\|$\\)" 1 nil] 4] shell-snarf-bang-dollar #[nil "└┴┬Åç" [nil (byte-code "└┴ ┬\"─┼ \"¡å ┬ö┬òO)ç" [ring-ref get-input-ring 1 prev-command string-match "[     ]+\\([^     \n;]+\\)[     ]*\\'"] 3) ((error))] 3] shell-process-popd #[(arg) "G┴U½â┴¬â┬!뽡 GW½º ┴U½å┼╞╟Ŭƒ┼ B ╔Z¢ë\nëAAíêA╦ *¬â╠═!)ç" [arg 0 shell-extract-num num shell-dirstack nil (byte-code "└    @!ê    A┬ ç" [comint-cd shell-dirstack shell-dirstack-message] 2) ((error (message "Couldn't cd."))) ds 1 cell shell-dirstack-message message "Bad popd."] 4] shell-process-cd #[(arg) "┴ܽâ┬ ├─┼Åç" [arg "!$" shell-snarf-bang-dollar nil (byte-code "└    G┬U½à├─!¬ü    !ê┼ ç" [comint-cd arg 0 getenv "HOME" shell-dirstack-message] 3) ((error (message "Couldn't cd.")))] 3] shell-process-pushd #[(arg) "┴ܽâ┬ G├U½à─┼╞Åç╟!ë½╝    GV½à╩╦!¬╕     BëG¢╨Z╨!¢!╥\"─╘╒Å-¬ë ─╫╪Å))ç" [arg "!$" shell-snarf-bang-dollar 0 nil (byte-code "½É    ├@!ê\nAB─ )ç┼╞!ç" [shell-dirstack default-directory old comint-cd shell-dirstack-message message "Directory stack empty."] 2) ((message "Couldn't cd.")) shell-extract-num num shell-dirstack message "Directory stack not that deep." default-directory ds dslen front reverse back append new-ds (byte-code "└    @!ê    A├ ç" [comint-cd new-ds shell-dirstack shell-dirstack-message] 2) ((error (message "Couldn't cd."))) old-wd (byte-code "└    !ê\n B─ ç" [comint-cd arg old-wd shell-dirstack shell-dirstack-message] 2) ((error (message "Couldn't cd.")))] 5] shell-extract-num #[(str) "└┴\n\"¡â├\n!ç" [string-match "^\\+[1-9][0-9]*$" str string-to-int] 3]] 2)
  89. (fset 'shell-dirtrack-toggle #[nil "?┴┬½â├¬ü─\"ç" [shell-dirtrackp message "directory tracking %s." "ON" "OFF"] 3 "\
  90. Turn directory tracking on and off in a shell buffer." nil])
  91. (fset 'shell-resync-dirs #[nil "└p!┬    !ëbê cê┼cê╞╟!ê╚     \"ê╚    ┼\"ê `╔ôê`\n┼cê╦╠!ê═╬!¼è╧    !ê\nbê¬q) bê╨╠!ê╟ö╟ò╠Z{ëG╔╟╟W½¢╒╓#ê╠ö╠òOB╟òë¬`╫!╔╪┘Å.ç" [get-buffer-process proc process-mark pmark shell-dirstack-query "\n" sit-for 0 comint-send-string nil pt backward-char 1 looking-at ".+\n" accept-process-output delete-char dl dl-len ds i string-match "\\s *\\(\\S +\\)\\s *" reverse (byte-code "└    @!ê    A├ ç" [comint-cd ds shell-dirstack shell-dirstack-message] 2) ((error (message "Couldn't cd.")))] 5 "\
  92. Resync the buffer's idea of the current directory stack.
  93. This command queries the shell with the command bound to 
  94. shell-dirstack-query (default \"dirs\"), reads the next
  95. line output and parses it to form the new directory stack.
  96. DON'T issue this command unless the buffer is at a shell prompt.
  97. Also, note that if some other subprocess decides to do output
  98. immediately after the query, its output will be taken as the
  99. new directory stack -- you lose. If this happens, just do the
  100. command again." nil])
  101. (fset 'comint-cd #[(d) "└┴\n!!ç" [cd substitute-in-file-name d] 3 "\
  102. Substitute environment variables before calling cd."])
  103. (defvar shell-dirstack-message-hook nil "\
  104. Hook to run after a cd, pushd or popd event")
  105. (fset 'shell-dirstack-message #[nil "└    \nB ½¿ @╞╟╚╔╩!\"\"½ê╦╠ò═OP╦ÿ½é╬ ╧Q A)¬U╨╤!ê╥ !*ç" ["" default-directory shell-dirstack ds msg dir string-match format "^%s\\(/\\|$\\)" getenv "HOME" "~/" 0 nil "~" " " run-hooks shell-dirstack-message-hook message] 5])
  106. (defvar shell-load-hook nil "\
  107. This hook is run when shell is loaded in.
  108. This is a good place to put keybindings.")
  109. (run-hooks 'shell-load-hook)
  110.